<template>

    <div>
        <el-row>
            <el-col :span="6">
                    报送部门：
                <el-select v-model="formData.department" placeholder="请选择">
                    <el-option
                            v-for="item in departments"
                            :key="item.value"
                            :label="item.label"
                            :value="item.label">
                    </el-option>
                </el-select>
            </el-col>

            <el-col :span="6">
                    故障分类：
                <el-select v-model="formData.category" placeholder="请选择">
                    <el-option
                            v-for="item in types"
                            :key="item.value"
                            :label="item.label"
                            :value="item.label">

                    </el-option>

                </el-select>
            </el-col>

            <el-col :span="6">
                    填报单位：
                <el-select v-model="formData.reDep" placeholder="请选择">
                    <el-option
                            v-for="item in departments2"
                            :key="item.value"
                            :label="item.label"
                            :value="item.label">
                    </el-option>
                </el-select>
            </el-col>

        </el-row>

        <el-row>
            <el-col :span="1">
                填报人:
            </el-col>
            <el-col :span="5">
                <el-input v-model="formData.reName"></el-input>
            </el-col>


            <el-col :span="6"></el-col>
            <el-col :span="6">
                <div class="demo-input-suffix">
                    填报日期：
                    <el-date-picker
                            v-model="formData.reDate"
                            type="date"
                            placeholder="选择日期">
                    </el-date-picker>

                </div>
            </el-col>

        </el-row>

        <el-col :xs="4" :sm="4" :md="4" :lg="4">
        </el-col>
        <el-row>
            <el-input type="textarea" :rows="8" placeholder="请输入内容" v-model="formData.detail">
            </el-input>
        </el-row>
        <el-button @click="success" type="success">点击报送</el-button>

    </div>
</template>

<script>

    import axios from '~/plugins/axios'

    export default {
        data() {
            return {
                departments: [{
                    value: '选项1',
                    label: '信息科'
                }, {
                    value: '选项2',
                    label: '办公室'
                }, {
                    value: '选项3',
                    label: '狱政科'
                }, {
                    value: '选项4',
                    label: '政治处'
                }, {
                    value: '选项5',
                    label: '基建办'
                }],
                departments2: [{
                    value: '选项1',
                    label: '信息科'
                }, {
                    value: '选项2',
                    label: '办公室'
                }, {
                    value: '选项3',
                    label: '狱政科'
                }, {
                    value: '选项4',
                    label: '政治处'
                }, {
                    value: '选项5',
                    label: '基建办'
                }],

                types: [{
                    value: '选项1',
                    label: '门禁故障'
                }, {
                    value: '选项2',
                    label: '软件故障'
                }, {
                    value: '选项3',
                    label: '摄像机故障'
                }, {
                    value: '选项4',
                    label: '下水道堵塞'
                }, {
                    value: '选项5',
                    label: '其他'
                }],
            formData:{
                    id: '',
                    name: '',
                    category: '',
                    desc: '',
                    detail: '' ,
                    reDep: '',
                    reName: '',
                    rePhone: '',
                    status: '',
                    department: '',
                    reDate: '',
                    dealDate
            :
                '',
                    dealDesc
            :
                ''
            }
            };
        },

        methods: {

            success() {
                this.$alert('报送成功', {confirmButtonText: '确定',});
                console.log(this.formData.reDep)
                axios.post('api/add/IssueList',this.formData)
            }
        }
    }


</script>

<style scoped>
    .el-row {
        margin-bottom: 20px;
    }

    .el-col {
        border-radius: 4px;
    }
</style>